feat(orchestrator): route per-queue storage through host profiles and fix the buildsignal republish dedup - #538
Merged
Conversation
behinddwalls
marked this pull request as ready for review
August 6, 2026 17:01
mnoah1
approved these changes
Aug 6, 2026
behinddwalls
force-pushed
the
preetam/queue-leading-schema
branch
from
August 6, 2026 20:47
22d8314 to
ecfcd55
Compare
… fix the buildsignal republish dedup ## Summary ### Why? Per-queue backend routing is host policy: profiles.go already routes every other seam (build runner, change provider, analyzer) per queue, so storage joins the same registry now that its contract is factory-resolved. Separately, end-to-end validation caught a regression from the payload change: repointing buildsignal's speculate publish from the batch-ID partition to the queue partition made its message share the (topic, partition, message-id) triple with the batch controller's original speculate publish, and the MySQL queue backend dedupes publishes on that triple against rows not yet garbage-collected — so the "build finished, re-evaluate" nudge was silently dropped and the batch stalled in Speculating. ### What? `Profile` gains a per-queue storage factory entry; every profile points at the shared MySQL backend by default and `Profiles.StorageFactory()` routes each resolution through the queue's profile, so a deployment that splits queues across backends overrides one field. The orchestrator's `Deps.Storage` now comes from the profile registry. Buildsignal keeps the queue partition (preserving per-queue serial ordering) but mints its speculate message ID from (batch, build) instead of reusing the bare batch ID, so the re-evaluation publish never collides with the batch controller's original message while a redelivered poll still dedupes against itself. ## Test Plan ✅ `make e2e-test` (submitqueue suite green — reproduces the Speculating stall without the message-ID fix) ✅ gateway + orchestrator integration suites via bazel ✅ `go test ./...` ✅ `make fmt` ✅ `make lint` ✅ `make check-tidy` ✅ `make check-gazelle`. Local docker-under-bazel runs need `--sandbox_writable_path=$HOME/.docker` for the image builds.
behinddwalls
force-pushed
the
preetam/storage-profile-routing
branch
from
August 6, 2026 20:49
29c8606 to
0cc7ace
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why?
Per-queue backend routing is host policy: profiles.go already routes every other seam (build runner, change provider, analyzer) per queue, so storage joins the same registry now that its contract is factory-resolved. Separately, end-to-end validation caught a regression from the payload change: repointing buildsignal's speculate publish from the batch-ID partition to the queue partition made its message share the (topic, partition, message-id) triple with the batch controller's original speculate publish, and the MySQL queue backend dedupes publishes on that triple against rows not yet garbage-collected — so the "build finished, re-evaluate" nudge was silently dropped and the batch stalled in Speculating.
What?
Profilegains a per-queue storage factory entry; every profile points at the shared MySQL backend by default andProfiles.StorageFactory()routes each resolution through the queue's profile, so a deployment that splits queues across backends overrides one field. The orchestrator'sDeps.Storagenow comes from the profile registry. Buildsignal keeps the queue partition (preserving per-queue serial ordering) but mints its speculate message ID from (batch, build) instead of reusing the bare batch ID, so the re-evaluation publish never collides with the batch controller's original message while a redelivered poll still dedupes against itself.Test Plan
✅
make e2e-test(submitqueue suite green — reproduces the Speculating stall without the message-ID fix) ✅ gateway + orchestrator integration suites via bazel ✅go test ./...✅make fmt✅make lint✅make check-tidy✅make check-gazelle. Local docker-under-bazel runs need--sandbox_writable_path=$HOME/.dockerfor the image builds.